<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
	/**
	 * CodeIgniter
	 *
	 * An open source application development framework for PHP 4.3.2 or newer
	 *
	 * @package		CodeIgniter
	 * @author		ExpressionEngine Dev Team
	 * @copyright	Copyright (c) 2008 - 2009, EllisLab, Inc.
	 * @license		http://codeigniter.com/user_guide/license.html
	 * @link		http://codeigniter.com
	 * @since		Version 1.0
	 * @filesource
	 */
	// ------------------------------------------------------------------------
	
	/**
	 * @package		CodeIgniter
	 * @subpackage	Libraries
	 * @author		AnhDT
	 */
	require_once APP_LIBRARY_PATH . 'tree/container/interfaces/st_container_interface.php';
	require_once APP_LIBRARY_PATH . 'doc/fx_block.php';
	class st_mini_block extends Fx_Block implements st_container_interface{
		protected $_title = '';
		public function __construct($_id = '') {
			if (empty($_id)) {
				$_id = md5(time());	
			}
			$this->setId($_id);
		}
		// Lấy về nội dung của container
		public function getContent() {
			$content = $this->getOutputHtml();
			return $content;	
		}
		// Xuất ra html
		public function outputHtml() {
			echo $this->getHeader();
			echo $this->getContent();
			echo $this->getFooter();
			return $this;
		}
		//Thiết lập template cho block
		public function setView($_file, $_parse = true) {
			$this->setTemplate($_file, $_parse);
			return $this;
		}
		//Dặt tiêu đề cho block
		public function setTitle($_title = '') {
			if (!empty($_title)) {
				$this->_title = $_title;
				return $this;
			}	
			return false;
		}
		
		// Lấy về tiêu đề của block
		public function getTitle() {
			return $this->_title;
		}	
		
		// Lấy về header của block
		public function getHeader() {
			if (empty($this->_title)) {
				return '';	
			}
			return "<h4>$this->_title</h4>\n";
		}
		
		// Lấy về footer của block
		public function getFooter() {
			return '';	
		}
	}

?>
	